{ext->get_field_value assign="value" name=$el.name parent=$data.page.id}
<input type="hidden" name="{$el.name}" value="{if !$value}0{else}{$value}{/if}">
<input type="hidden" name="x_{$el.name}" value="{if !$value}0{else}{$value}{/if}">
<div style="border-top:1px solid #DBE1E5;">
<script type="text/javascript" language="javascript1.4">
<!--
function InsertFromGallery(status, slastKey){ldelim}
	if (status == 1){ldelim}
		document.getElementById('div_'+slastKey).innerHTML = "{t t='Įdetas iš galeryjos'}. <a href='#' onClick='InsertFromGallery(2, \""+slastKey+"\");'>{t t='Nuimti'}</a>";
	{rdelim} else {ldelim}
		document.forms['form{$smarty.get.id}'].x_{$el.name}.value = 0;
		document.getElementById('div_'+slastKey).innerHTML = '<input name="'+slastKey+'" accept="image/gif" type="file" class="defaultInputText">';		
	{rdelim}
{rdelim}
//-->
</script>

<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#F8F9F9">
	<tr>
		<td width="15">&nbsp;</td>
		<td class="defaultFormLabel" width="170" height="25"><nobr>{t t=$el.name}</nobr></td>
		<td>
		<!-- *  -->
		{if $value}
		{ext->get_binary_data id=$value assign='image_data'}		
		<table width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td><a href="get.php?f.{$value}" style="margin:5px 10px 5px 0px">{$image_data.name}</a> {if $image_data.info.size}<span style="color:#A8B3B8;">{if $image_data.info.size>1048576}{math equation="x/1024/1024" x=$image_data.info.size format="%.2F"}mb{else}{math equation="x/1024/1024" x=$image_data.info.size format="%.2F"}kb{/if}</span>{/if}</td>	
				<td width="1"><input type="button" name="{t t='Ištrinti'}" value="{t t='Ištrinti'}" class="defaultFormButton" onClick="window.location='index.php?admin=1&mod=file&act=del&image_id={$value}&field_name={$el.name}&parent={$data.page.id}&referer={ext->get_referer}'"></td>	
				<td width="25">&nbsp;</td>
			</tr>
		</table>
		{else}
		<table width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td><div id="div_{$el.name}"><input name="{$el.name}" type="file" class="defaultInputText" /></div></td>	
				<td width="30"><a href="#" onClick="openCenteredOnOpenerWindow('index.php?admin=1&insfil=1&mode=infield&parent={$data.page.id}&tpl_parent_name={$data.page.name|urlencode}&field={$el.name}','inspic',600,500,'','scrollbars',opener); return false;"><img src="_tvs_system_core_/design/img/admin/_icon_file.gif" border="0" align="absmiddle" alt="Insert file" /></a></td>
			</tr>
		</table>
		{/if}
		<!-- /*  -->
		</td>		
	</tr>
</table>

</div>